<?php

use Illuminate\Routing\Router;

Route::group([
    'domain'=>config('admin.route.domain'),
    'prefix' => config('admin.route.api_prefix'),
    'namespace'=>config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {
    $router->get('/', 'HomeController@home')->name('admin.home');
    $router->get('/home', 'HomeController@home')->name('admin.home');
    $router->any('/home', 'HomeController@home')->name('admin.home.post');

    // 用户地址
    $router->resource('/member/address', 'MemberAddressController')->names('admin.member.address.list');

    // 客户管理
    $router->resource('/member', 'MemberController')->names('admin.member.list');

    // 编辑积分
    // $router->post('/member/score', 'MemberController@getScore')->name('admin.member.score');

    // 积分日志列表
    // $router->resource('/member/score/log', 'MemberScoreLogController')->names('admin.member.score.log.list');

    // 活动列表
    // $router->resource('/activity/list', 'ActivityController')->names('admin.activity.list');

    //作废客户报名
    // $router->get('/activity/enter/cancel/{id?}' ,'ActivityEnterController@cancel')->name('admin.activity.enter.cancel');

    //会员参与的活动 如果有get方法 resource要放到最后 不然会报 show does not exist 的问题
    // $router->resource('/activity/enter', 'ActivityEnterController')->names('admin.activity.enter.list');

    // 分类管理
    $router->resource('/goods/class', 'GoodsClassController')->names('admin.goods.class.list');

    // 品牌管理
    $router->resource('/goods/brand', 'BrandController')->names('admin.goods.brand.list');

    // 产品列表
    $router->resource('/goods/list', 'GoodsController')->names('admin.goods.list');

    // 产品操作
    $router->post("/goods/addGoodsAttr", "GoodsController@addGoodsAttr")->name("addGoodsAttr");

    $router->post("/goods/addGoodsAttrValue", "GoodsController@addGoodsAttrValue")->name("addGoodsAttrValue");

    // 社区管理
    // $router->resource('/community', 'CommunityController')->names('admin.community.list');

    // 设置
    $router->resource('/setting' ,'SettingController')->names('admin.setting.info');

    // 保存设置
    $router->post('/setting/save' ,'SettingController@saveSettings')->name('admin.setting.set');

    // 订单管理
    $router->resource('/orders', 'OrderController')->names('admin.order.list');

    // 订单作废
    $router->post('/order/invalid' ,'OrderController@invalidOrder')->name('admin.order.invalid');

    // 订单核销
    // $router->get('/order/delivery/{id?}' ,'OrderController@deliveryOrder')->name('admin.order.delivery');

    //订单发货
    $router->post('/order/delivery' ,'OrderController@deliveryOrder')->name('admin.order.delivery');

    // 支付单
    $router->resource('/payment', 'PaymentController')->names('admin.payment.list');

    // 发货单
    $router->resource('/delivery', 'DeliveryController')->names('admin.delivery.list');

    // 订单日志
    $router->resource('/order/log', 'OrderLogController')->names('admin.order.logs');

    // 上传图片
    $router->post('/upload', 'SettingController@uploadImage')->name('admin.setting.upload');

    // 公众号菜单管理
    // $router->resource('/wechat/menu', 'WeChatController')->names('admin.wechat.menu');

    // 轮播图设置
    $router->resource('/slideshow', 'SlideshowController')->names('admin.slideshow.list');

    // 物流公司
    $router->resource('/expressCompany', 'ExpressCompanyController')->names('admin.expressCompany.list');

});

